package com.fenyin.samples.study.jdk.net;  

import java.net.InetAddress;
import java.net.UnknownHostException;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
  
public class InetAddressTest {
	
	private static final Log log = LogFactory.getLog(InetAddressTest.class);
	
	@Test
	public void hostTest() throws UnknownHostException{
		InetAddress addr = InetAddress.getLocalHost();
		log.info("hostname:"+addr.getHostName());
		log.info("hostaddr:"+addr.getHostAddress());
	}
	
	
}
